package com.cdks.wuxiu.api.service;


import java.util.List;
import java.util.Set;

import com.cdks.wuxiu.api.model.dto.CallScoreInfoDTO;
import com.cdks.wuxiu.entity.mysql.CallSheetInfo;
import com.cdks.wuxiu.entity.mysql.UserBaseInfo;


/**
 * 通话服务类
 */
public interface CallService {
    CallSheetInfo getSheetByUcid(String ucid);
    CallSheetInfo getSheetByUcidWithCaller(String ucid, long caller);
    CallSheetInfo getSheetByUcidWithAnswer(String ucid, long answer);
    CallSheetInfo getSheetByUcidWithAnyUser(String ucid, long userId);
    CallSheetInfo getBusyCallByCaller(long userId);
    CallSheetInfo getBusyCallByAnswer(long userId);
    CallSheetInfo getBusyCallAnyUser(long caller, long answer);
    CallSheetInfo getStartedCallAnyUser(long callerId, long answerId);
    CallSheetInfo getStartedCallBothUser(long callerId, long answerId);
    CallSheetInfo getPayedCallBothUser(long callerId, long answerId);
    CallSheetInfo getSheetBySipId(String sipId);

    int callout(CallSheetInfo sheet, UserBaseInfo caller);
    int ringing(CallSheetInfo sheet);
    int answer(CallSheetInfo sheet);
    int hangup(CallSheetInfo sheet);
    int keepAlive(CallSheetInfo sheet);
    int finish(CallSheetInfo sheet);
    int setCallKeepTime(long userId, long time, String ucid);
    int getCallKeepTime(long userId, String ucid);
    int callEvalute(CallSheetInfo sheet, int score, String content);
    int hangupCallByStatus(CallSheetInfo sheet, int status);
    int hangupRandCall(CallSheetInfo sheet, int why, String hint);
    int updateListenerInfo(CallSheetInfo sheet, UserBaseInfo userInfo);

    UserBaseInfo selectCallee(long selfId, int userType, int role, int sex, int balance, Set<Long> excludes);
    UserBaseInfo getRandAnswer(long selfId, int userType, int role, int sex, int balance, Set<Long> excludes);

    List<UserBaseInfo> getNoticeCallee(long caller, int userType, int role, long answer);
    List<UserBaseInfo> getRandCallee(long selfId, int userType, int role, int sex);
    List<CallScoreInfoDTO> getCallScoreList(int page, long userId);
    List<CallSheetInfo> getFreeCallByCaller(long callerId);
}
